package com.foreknow.demo1;

/**
 * 数据类型的转换
 *  byte---->short---->int---->long---->float---->double            char---->int
 */
public class DataTypeConvert {
    public static void main(String[] args) {
        byte b = 28;
        int a = b; //自动类型转换
        int c = 123;
        double d = c; //自动类型转换
        System.out.println(a);
        System.out.println(d);

        float f = 3.14F;
        double m = 3.1415926;
        int k = (int) m; //强制类型转换
        System.out.println(k);

        int i = 65;
        char j = (char) i; //强制类型转换
        System.out.println(j);
    }
}
